<template>
  <div class="box">
    <div class="loader">
      <div class="rocket">
        <i class="iconfont icon-rocket-full"></i>
        <i class="iconfont icon-yun" style="--i:0;"></i>
        <i class="iconfont icon-yun" style="--i:1;"></i>
        <i class="iconfont icon-yun" style="--i:2;"></i>
        <i class="iconfont icon-yun" style="--i:3;"></i>
      </div>
      <span>
        <i></i>
      </span>
    </div>
  </div>
</template>

<script setup>

</script>

<style lang="less" scoped>
.box {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background-color: none;
  width: 100px;
  height: 100px;
}

.loader {
  position: relative;
  display: flex;
  transform: scale(0.6);

  span {
    position: relative;
    width: 250px;
    height: 250px;
    background-color: #eaeef0;
    border: 6px solid #eaeef0;
    border-radius: 50%;
    box-shadow: -8px -8px 15px rgba(24, 24, 24, 0.1),
      8px 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;

    i {
      position: absolute;
      background: linear-gradient(#42abff, #ff4f8b, #ffeb3b);
      border-radius: 50%;
      inset: 0;
      animation: animate 1s linear infinite;
      filter: blur(5px);
    }

    @keyframes animate {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }
  }

  span::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 10px 10px 20px rgba(0, 0, 0, 0.5),
      inset -5px -5px 15px rgba(255, 255, 255, 1);
    overflow: hidden;
  }

  span::after {
    content: '';
    position: absolute;
    inset: 35px;
    background-color: #eaeef0;
    border: 3px solid #eaeef0;
    border-radius: 50%;
    box-shadow: -8px -8px 25px rgba(255, 255, 255, 1),
      8px 8px 25px rgba(0, 0, 0, 0.25),
      inset 3px 3px 10px rgba(0, 0, 0, 0.15),
      inset -1px -1px 15px rgba(255, 255, 255, 1);
  }

  .rocket {
    position: absolute;
    display: flex;
    inset: 50px;
    z-index: 10;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 50%;

    .icon-rocket-full {
      position: absolute;
      color: #ff518c;
      font-size: 3.8em;
      -webkit-text-stroke: 2px #000;
      animation: rocket 0.2s linear infinite;
    }

    @keyframes rocket {

      0%,
      100% {
        transform: translate(0, 0) rotate(-45deg);
      }

      50% {
        transform: translate(-1px, 3px) rotate(-45deg);
      }
    }

    @keyframes rocket2 {

      0%,
      100% {
        transform: translate(0, 0px) rotate(-45deg);
      }

      50% {
        transform: translate(-3px, 6px) rotate(-45deg);
      }
    }

    .icon-yun {
      position: absolute;
      top: calc(35px * var(--i));
      left: calc(45px * var(--i));
      font-size: 2em;
      color: #fff;
      -webkit-text-stroke: 2px #000;
      animation: cloud 1.5s linear infinite;
      animation-delay: calc(-0.5s * var(--i));
    }

    @keyframes cloud {
      0% {
        transform: translateY(calc(-35 * 5px));
      }

      100% {
        transform: translateY(calc(35 * 5px));
      }
    }


    &:hover>.icon-rocket-full {
      color: #ef3774 !important;
      animation: rocket2 0.2s linear infinite;
    }

    &:hover>.icon-yun {
      animation-duration: 1s;
      animation-delay: calc(-0.2s * var(--i));
    }
  }
}
</style>